﻿using IterationLife.ContentResources.Models;
using IterationLife.Extensions.Dtos;

namespace IterationLife.Mobile.AppServices.Dtos.Common
{
    /// <summary>
    /// 内容资源图片详情[输出]
    /// </summary>
    public class ContentResourcePictureOutPut
    {
        /// <summary>
        /// 图片
        /// </summary>
        public string Picture { get; set; }

        /// <summary>
        /// 说明
        /// </summary>
        public string Explain { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        public int? SortId { get; set; }
    }

    /// <summary>
    /// 内容资源图片详情[输出]扩展
    /// </summary>
    public static class ContentResourcePictureOutPutExtension
    {
        /// <summary>
        /// 转换为内容资源图片详情[输出]
        /// </summary>
        /// <param name="entity">内容资源</param>
        public static ContentResourcePictureOutPut ToNewsPictureOutPut(this ContentResourcePicture entity)
        {
            return new ContentResourcePictureOutPut
            {
                Picture = entity.Picture.Address,
                Explain = entity.Explain,
                SortId = entity.SortId
            };
        }
    }
}
